home *** CD-ROM | disk | FTP | other *** search
- Fix Reload of Network Files (FIXNETLD.MOD)
- Goose #1 @17310
- Saturday, December 28, 1991 8:35 pm
- Fix Reload for Network Files (FIXNETLD.MOD)
- by Goose, 1@17310 (WWIVlink)
-
- This mod fixes a minor bug in the WWIV source code for v4.20. I'm not sure if
- the bug is present in older versions, but I'm sure someone will attempt to
- install it and find out. This is one I found when installing Jim Wire's
- SWITCH mod to run Dual Networks -- everytime the board switched from one
- network to the other, it would lose a little memory. After figuring out it
- wasn't A) an error in my installation of the mod, or B) an error in the mod
- itself, I traced through the code to the point where I found a variable
- getting allocated, but never release before being reallocated. What this
- basically meant is that a little bit of memory would be lost whenever
- //SWITCHing from one system to another, //RELOADing the menus, or receiving a
- network update and running NETWORK3 without shrinking out. I guess the bug
- was obscure enough though that it was never found, at least until now.
- Since the default for the board is to shrink for NETWORK3, and most sysops
- don't use //RELOAD that often, this mod won't be too noticable unless you
- have the switch mod in (or another mod that re-reads the network files).
-
- For the change, go into SYSOPF.C, void read_new_stuff(), and add the three
- lines shown to reinitialize the csn_index variable:
-
- if (con!=NULL)
- farfree(con);
- if (csn_index!=NULL) /* mod - add */
- farfree(csn_index); /* mod - add */
- ncn=NULL;
- cnn=NULL;
- csn=NULL;
- con=NULL;
- csn_index=NULL; /* mod - add */
- read_in_file("MENUS.MSG",(menus),30);
-
- Then in NETSUP.C, make similar changes in int check_bbsdata (NOTE that this
- function actually appears in the code twice. Make sure you make the same
- change in both places!!!):
-
- if (con!=NULL)
- farfree(con);
- if (csn_index!=NULL) /* mod - add */
- farfree(csn_index); /* mod - add */
- read_bbs_list_index();
- read_contacts();
-
- Recompile the two files and you're all set -- no more dissappearing memory,
- at least not due to this bug.
- 9
- 9 1The Twilight Zone 6≡2 703-369-5225 6≡5 14.4K USR DS 6≡3 WWIV Support0